package com.designPattern.proxy;

/**
 * 云玩家平台，使用jdk动态代理
 * @author : liutianlong
 * @date : 2023/5/25
 * @since : 1.0
 */
public class CloudPlayPlatform {

    public static void main(String[] args) {
        // 创建玩家
        LilyPlayer lilyPlayer = new LilyPlayer("lily");

        // 创建代理工厂
        WholeDayFactory<IPlayer> wholeDayFactory = new WholeDayFactory(lilyPlayer);

        // 生成代理对象
        IPlayer proxy = wholeDayFactory.createProxy();

        // 执行方法
        proxy.login();

        proxy.play();
    }
}
